package com.gakj.truck.third.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.gakj.truck.third.api.service.UserTmpService;
import com.gakj.truck.third.core.utils.RequestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 第三方用户信息相关操作
 * 该类只是一个查看保存的结果的作用
 */
@RestController
@RequestMapping(value="/third/user")
public class UserTmpController {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserTmpController.class);

	@Autowired
	UserTmpService usService;
	
	
    @RequestMapping(value = "/saveOrUpdate",method = RequestMethod.POST)
    public JSONObject update(
            @RequestParam(value = "userid") Long userid,
            @RequestParam(value = "data") String data,
            @RequestParam(value = "source",defaultValue = "0") String source
    ){

        LOGGER.info("请求方法:{userTmpController/update}");
        LOGGER.info("用户id:"+userid);
        LOGGER.info("更新信息:"+data);
        return RequestUtils.success("");
    }

    @RequestMapping(value = "/check/om",method = RequestMethod.GET)
    public JSONObject checkOumanUser(
            @RequestParam(value = "username") String username,
            @RequestParam(value = "pwd") String pwd,
            @RequestParam(value = "tel") String tel,
            @RequestParam(value = "source",defaultValue = "0") String source
    ){

        JSONObject result = usService.checkOumanUser(username,pwd,tel);
        return result;
    }


}
